package com.asset.dispoal.file.document.service;

import com.asset.dispoal.file.document.api.DocumentService;
import com.asset.dispoal.file.document.dto.DocumentAddRequest;
import com.asset.dispoal.file.document.dto.DocumentPageRequest;
import com.asset.dispoal.file.document.dto.DocumentPageResponse;
import com.asset.dispoal.file.document.dto.DocumentTypeAddRequest;
import com.asset.dispoal.file.document.dto.DocumentTypePageRequest;
import com.asset.dispoal.file.document.dto.DocumentTypePageResponse;
import com.asset.dispoal.file.document.service.command.DocumentAddCommand;
import com.asset.dispoal.file.document.service.command.DocumentDelCommand;
import com.asset.dispoal.file.document.service.command.DocumentQueryPageCommand;
import com.asset.dispoal.file.document.service.command.DocumentTypeAddCommand;
import com.asset.dispoal.file.document.service.command.DocumentTypeDelCommand;
import com.asset.dispoal.file.document.service.command.DocumentTypeIdQueryCommand;
import com.asset.dispoal.file.document.service.command.DocumentTypeQueryPageCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

@Service
public class DocumentServiceImpl implements DocumentService {

    @Autowired
    private DocumentTypeAddCommand documentTypeAddCommand;

    @Autowired
    private DocumentTypeDelCommand documentTypeDelCommand;

    @Autowired
    private DocumentTypeQueryPageCommand documentTypeQueryPageCommand;

    @Autowired
    private DocumentTypeIdQueryCommand documentTypeIdQueryCommand;

    @Autowired
    private DocumentAddCommand documentAddCommand;

    @Autowired
    private DocumentDelCommand documentDelCommand;

    @Autowired
    private DocumentQueryPageCommand documentQueryPageCommand;


    @Override
    public Result insertType(DocumentTypeAddRequest request) {
        return documentTypeAddCommand.execute(request);
    }

    @Override
    public Result deleteType(String id) {
        return documentTypeDelCommand.execute(id);
    }

    @Override
    public Result insert(DocumentAddRequest documentAddRequest) {
        return documentAddCommand.execute(documentAddRequest);
    }

    @Override
    public Result delete(String id) {
        return documentDelCommand.execute(id);
    }

    @Override
    public Result<PageVO<DocumentTypePageResponse>> queryTypePage(DocumentTypePageRequest request) {
        return documentTypeQueryPageCommand.execute(request);
    }

    @Override
    public Result<DocumentTypePageResponse> getTypeById(String id) {
        return documentTypeIdQueryCommand.execute(id);
    }

    @Override
    public Result<PageVO<DocumentPageResponse>> queryPage(DocumentPageRequest request) {
        return documentQueryPageCommand.execute(request);
    }


}
